libxl: use llabs() instead abs() for int64_t argument
authorJuergen Gross <jgross@suse.com>
Tue, 2 Aug 2016 17:25:42 +0000 (19:25 +0200)
committerWei Liu <wei.liu2@citrix.com>
Wed, 3 Aug 2016 09:46:58 +0000 (10:46 +0100)
commit45a348ebaba3f6e0a26455a3ff181a41722943a0
tree88aef5346acd85637d97b5544c311ae01bd8c1b5
parente9522e4932aaa7f083688b6612b5897839409260
libxl: use llabs() instead abs() for int64_t argument

Commit 57f8b13c724023c78fa15a80452d1de3e51a1418 ("libxl: memory size
in kb requires 64 bit variable") introduced a bug: abs() shouldn't
be called with an int64_t argument. llabs() is to be used here.

Caught by clang build with error message:

libxl.c:4198:33: error: absolute value function 'abs' given an argument
of type
    'int64_t' (aka 'long') but has parameter of type 'int' which may cause
    truncation of value [-Werror,-Wabsolute-value]
    if (target_memkb < 0 && abs(target_memkb) > current_target_memkb)

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl.c